---
layout: m1x_soap
title: Sales Order Shipment
---
				    
<h2><a name="MAPI-Shipment-Module%3AMageSales"></a>Module: Mage_Sales</h2>

<p>The Mage_Sales module allows you to manage sales orders, invoices, shipments, and credit memos.</p>

<h4><a name="MAPI-Shipment-Shipment"></a>Shipment</h4>

<p>Allows you to manage shipments and tracking numbers.</p>

<p><b>Resource Name</b>: sales_order_shipment</p>

<p><b>Aliases</b>:</p>
<ul>
	<li>order_shipment</li>
</ul>


<p><b>Methods</b>:</p>
<ul>
	<li><a href="sales_order_shipment.list.html" title="sales_order_shipment.list">sales_order_shipment.list</a><font color="#000000">&nbsp;&#45; Retrieve a list of shipments using filters</font></li>
	<li><a href="sales_order_shipment.info.html" title="sales_order_shipment.info">sales_order_shipment.info</a><font color="#000000">&nbsp;&#45; Retrieve information about the shipment</font></li>
	<li><a href="sales_order_shipment.create.html" title="sales_order_shipment.create">sales_order_shipment.create</a><font color="#000000">&nbsp;&#45; Create a new shipment for an order</font></li>
	<li><a href="sales_order_shipment.addComment.html" title="sales_order_shipment.addComment">sales_order_shipment.addComment</a><font color="#000000">&nbsp;&#45; Add a new comment to a shipment</font></li>
	<li><a href="sales_order_shipment.addTrack.html" title="sales_order_shipment.addTrack">sales_order_shipment.addTrack</a><font color="#000000">&nbsp;&#45; Add a new tracking number to a shipment</font></li>
	<li><a href="sales_order_shipment.removeTrack.html" title="sales_order_shipment.removeTrack">sales_order_shipment.removeTrack</a><font color="#000000">&nbsp;&#45; Remove tracking number from a shipment</font></li>
	<li><a href="sales_order_shipment.getCarriers.html" title="sales_order_shipment.getCarriers">sales_order_shipment.getCarriers</a><font color="#000000">&nbsp;&#45; Retrieve a list of allowed carriers for an order</font></li>
</ul>


<h4><a name="MAPI-Shipment-Faults"></a>Faults</h4>


<table><tbody>
<tr>
<th> <font color="#555555">Fault Code</font> </th>
<th> <font color="#555555">Fault Message</font> </th>
</tr>
<tr>
<td> <font color="#555555">100</font> </td>
<td> <font color="#555555">Requested shipment not exists.</font> </td>
</tr>
<tr>
<td> <font color="#555555">101</font> </td>
<td> <font color="#555555">Invalid filters given. Details in error message.</font> </td>
</tr>
<tr>
<td> <font color="#555555">102</font> </td>
<td> <font color="#555555">Invalid data given. Details in error message.</font> </td>
</tr>
<tr>
<td> <font color="#555555">103</font> </td>
<td> <font color="#555555">Requested order not exists.</font> </td>
</tr>
<tr>
<td> <font color="#555555">104</font> </td>
<td> <font color="#555555">Requested tracking not exists.</font> </td>
</tr>
<tr>
<td> <font color="#555555">105</font> </td>
<td> <font color="#555555">Tracking not deleted. Details in error message.</font> </td>
</tr>
</tbody></table>


<h4><a name="MAPI-Shipment-Examples"></a>Examples</h4>

<h5><a name="MAPI-Shipment-Example1.Basicworkingwithshipments"></a>Example 1. Basic working with shipments</h5>
<div class="code panel" style="border-width: 1px;"><div class="codeContent panelContent">
<div>
		<pre class="theme: Default; brush: java; gutter: false">$proxy = new SoapClient('http://magentohost/api/soap/?wsdl');
$sessionId = $proxy-&gt;login('apiUser', 'apiKey');

$notShipedOrderId  = '100000003';

// Create new shipment
$newShipmentId = $proxy-&gt;call($sessionId, 'sales_order_shipment.create', array($notShipedOrderId, array(), 'Shipment Created', true, true));

// View new shipment
$shipment = $proxy-&gt;call($sessionId, 'sales_order_shipment.info', $newShipmentId);

var_dump($shipment);


// Get allowed carriers for shipping
$allowedCarriers = $proxy-&gt;call($sessionId, 'sales_order_shipment.getCarriers', $notShipedOrderId);

end($allowedCarriers);

$choosenCarrier = key($allowedCarriers);

var_dump($allowedCarriers);
var_dump($choosenCarrier);

// Add tracking
$newTrackId = $proxy-&gt;call($sessionId, 'sales_order_shipment.addTrack', array($newShipmentId, $choosenCarrier, 'My Track', rand(5000, 9000)));

$shipment = $proxy-&gt;call($sessionId, 'sales_order_shipment.info', $newShipmentId);

var_dump($shipment);</pre>
		</div>
</div></div>

				    
Create the Magento file system owner                   			    
